<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  let arr = [1, 2, 3, 4]

  function movie(array, from, to) {
    if (from < 0 || to > array.length - 1) {
      console.error('参数错误')
      return
    }
    let temp = [...array]
    let item = temp.splice(from, 1);
    temp.splice(to, 0, ...item)
    return temp;
  }

  console.log(movie(arr, 0, 3))
</script>
</body>
</html>